﻿<%@ Page Title="Cài đặt" Language="C#" MasterPageFile="~/Manager.Master" AutoEventWireup="true" CodeBehind="Setting.aspx.cs" Inherits="Manager.Setting" %>

<%@ Register Assembly="CKFinder" Namespace="CKFinder" TagPrefix="CKFinder" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">

    function BrowseServer() {
        // You can use the "CKFinder" class to render CKFinder in a page:
        var finder = new CKFinder();
        finder.basePath = '../'; // The path for the installation of CKFinder (default = "/ckfinder/").
        finder.selectActionFunction = SetFileField;
        finder.popup();

        // It can also be done in a single line, calling the "static"
        // popup( basePath, width, height, selectFunction ) function:
        // CKFinder.popup( '../', null, null, SetFileField ) ;
        //
        // The "popup" function can also accept an object as the only argument.
        // CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
    }

    // This is a sample function which is called when a file is selected in CKFinder.
    function SetFileField(fileUrl) {
        document.getElementById('contentPage_hiddenImg').value = fileUrl;
        document.getElementById('thumbnails').innerHTML +=
			'<div>' +
				'<img src="' + fileUrl + '" style="width: 60px; height: 60px;" />' +
			'</div>';

        document.getElementById('preview').style.display = "";
        document.getElementById('image').style.display = "none";
    }

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="contentPage" runat="server">
    <div class="breadcrumb">
            
    <a href="Default.aspx">Trang quản trị</a> >> <a href="Setting.aspx">Cài đặt</a>
</div>
        <div id="Div1" class="box" style="float:left; width: 100%" runat="server">
        <div class="heading">
            <h1><img src="../Styles/Img/Setting.png" alt="" />Cài đặt</h1>            
        </div>
        <div class="content">
        <br />
                <table class="update" cellspacing="10px" cellpadding="10px" width="680px">
                    <tbody>
   <tr class="filter"><td colspan="2">&nbsp;</td></tr>
                        <tr>
                            <td colspan="2" class="center">
                                <span class="required">
                                    <asp:Label ID="lblMessage" runat="server" Text="" Visible="false"></asp:Label></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span class="required">*</span> Tên Trang Web: 
                            </td>
                            <td>
                                <asp:TextBox ID="txtName" runat="server" Width="250px"></asp:TextBox><br />
                                <asp:Label ID="lblErrName" runat="Server" Font-Italic="true" ForeColor="Red"></asp:Label>                                
                            </td>
                        </tr>
                        <tr>
                    <td style="width: 200px; text-align: left;">
                        <span class="required"></span> Ảnh: 
                    </td>
                    <td style="text-align: left;"><br />
                                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                	<tr>
                                		<td style="text-align: center; border-right: 0px; width: 90px;">
	                                    <div id="preview" style="display: none;">
		                                    <div id="thumbnails"></div>
	                                    </div>
                                        <div style="text-align: center;" id="image">
                                            <asp:Image ID="imgThumb" runat="server" Width="60px" Height="60px" />
                                        </div>
                                            <br />
                                            <asp:LinkButton ID="lblDel" runat="server" onclick="lblDel_Click">Xóa</asp:LinkButton>
                                        </td>
                                        <td style="text-align: left; border-left: 0px;">
                                            <input id="btnSelectImg" type="button" value="Chọn ảnh" class="button" onclick="BrowseServer();" />
                                            <asp:HiddenField ID="hiddenImg" runat="server" />  
                                        </td>
                                	</tr>
                                </table>        
                            </td>
                </tr>
                        <tr>
                            <td>Địa chỉ Trang web : </td>
                            <td>
                                <asp:TextBox ID="txtURL" runat="server" Width="250px"></asp:TextBox><br />
                            </td>
                        </tr>
                        <tr>
                            <td>Địa chỉ: </td>
                            <td>
                                <asp:TextBox ID="txtAddress" runat="server" Width="300px"></asp:TextBox><br />
                            </td>
                        </tr>
                        <tr>
                            <td>Địa chỉ Email: </td>
                            <td>
                                <asp:TextBox ID="txtEmail" TextMode="Email" runat="server" Width="300px"></asp:TextBox><br />
                                <asp:Label ID="lblErrEmail" runat="Server" Font-Italic="true" ForeColor="Red"></asp:Label>  
                            </td>
                        </tr>
                        <tr>
                            <td>Điện thoại: </td>
                            <td>
                                <asp:TextBox ID="txtPhone" runat="server" Width="120px"></asp:TextBox><br />
                            </td>
                        </tr>
                        <tr>
                            <td>Năm hoạt động: </td>
                            <td>
                                <asp:TextBox ID="txtYear" runat="server" Width="120px"></asp:TextBox><br />
                            </td>
                        </tr>
                        <tr>
                            <td>Ghi chú: </td>
                            <td>
                                <asp:TextBox ID="txtDes" runat="server" Width="450px" Height="40px" 
                                    TextMode="MultiLine"></asp:TextBox>   
                            </td>
                        </tr>
                        <tr>
                            <td>Từ khóa (Keywords): </td>
                            <td>
                                <asp:TextBox ID="txtKeywords" runat="server" Width="450px" Height="80px" 
                                    TextMode="MultiLine"></asp:TextBox>   
                            </td>
                        </tr>
                        <tr>
                            <td>Giới thiệu: </td>
                            <td>
                                <CKEditor:CKEditorControl ID="editorAbout" Width="480px" Height="120px" 
                                    runat="server"></CKEditor:CKEditorControl>
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td>Trạng thái: </td>
                            <td>
                                <asp:RadioButton ID="rbtActive" GroupName="grnActive" runat="server" Checked="true" Text="Hoạt động" /> &nbsp;&nbsp; 
                                <asp:RadioButton ID="rbtDeactive" GroupName="grnActive" runat="server" Text="Không hoạt động" />     
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <asp:Button ID="btnSave" runat="server" CssClass="button" Text="Lưu lại" 
                                    OnClientClick="return confirm('Bạn có muốn Cập nhật không?')" 
                                    onclick="btnSave_Click" />
                                <asp:Button ID="btnClose" runat="server" CssClass="button" Text="Thoát" 
                                    onclick="btnClose_Click" />
                            </td>
                        </tr>
   <tr class="filter"><td colspan="2">&nbsp;</td></tr>
                    </tbody>
                </table>
            </div>
        </div>

</asp:Content>